﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Rison.Web.Common;
using Rison.BusinessFacade.Common;
using Rison.BusinessFacade.Helper;
using Rison.BusinessFacade.Facade.Biz;

namespace Rison.Web
{
    public partial class DefaultBak : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //测试时用，默认一个登录的用户
            CurrentLoginedUser.SetCurrentUserId("admin", "111111");

            InitData();

            BindGongGao();

            BindJFDT();
        }

        private void InitData()
        {
            //部门
            this.drpDepartment.DataSource = null;
            this.drpDepartment.DataBind();

            //诉求类别
            this.drpSQLB.DataSource = null;
            this.drpSQLB.DataBind();
        }

        private void BindGongGao()
        {
            this.gvGongGao.DataSource = GetGongGao();
            this.gvGongGao.DataBind();
        }

        private DataTable GetGongGao()
        {
            DataTable testSource = new DataTable();
            testSource.Columns.Add("Url", typeof(System.String));
            testSource.Columns.Add("Title", typeof(System.String));
            DataRow dr = null;
            for (int i = 1; i < 5; i++)
            {
                dr = testSource.NewRow();
                dr["Url"] = "#";
                if (i % 2 == 0)
                    dr["Title"] = "祝所有客户“五一”节日快乐!";
                else
                    dr["Title"] = "华北电视台管理机制改革咨询项目启动";

                testSource.Rows.Add(dr);
            }
            return testSource;

        }

        private void BindJFDT()
        {
            this.gvJFDT.DataSource = GetJFDT();
            this.gvJFDT.DataBind();

            this.gvJFFC.DataSource = GetJFFC();
            this.gvJFFC.DataBind();

            this.gvZXSQ.DataSource = GetZXSQ();
            this.gvZXSQ.DataBind();


            this.gvHFQK.DataSource = GetJFFC();
            this.gvHFQK.DataBind();
        }

        private DataTable GetJFDT()
        {
            DataTable testSource = new DataTable();
            testSource.Columns.Add("Url", typeof(System.String));
            testSource.Columns.Add("Title", typeof(System.String));
            testSource.Columns.Add("Day", typeof(System.DateTime));
            DataRow dr = null;
            for (int i = 1; i <= 5; i++)
            {
                dr = testSource.NewRow();
                dr["Url"] = "#";
                if (i % 2 == 0)
                    dr["Title"] = "关于2010年上海市纠风在线网站工作综述";
                else
                    dr["Title"] = "松江区质监局积极开展企业服务年活动";

                dr["day"] = DateTime.Now;

                testSource.Rows.Add(dr);
            }
            return testSource;

        }

        private DataTable GetJFFC()
        {
            DataTable testSource = new DataTable();
            testSource.Columns.Add("Url", typeof(System.String));
            testSource.Columns.Add("Title", typeof(System.String));
            testSource.Columns.Add("Day", typeof(System.DateTime));
            DataRow dr = null;
            for (int i = 1; i <= 5; i++)
            {
                dr = testSource.NewRow();
                dr["Url"] = "#";
                if (i % 2 == 0)
                    dr["Title"] = "国有企业反腐倡廉建设工作会议";
                else
                    dr["Title"] = "2010年度纠风信息采用情况";

                dr["day"] = DateTime.Now;

                testSource.Rows.Add(dr);
            }
            return testSource;

        }

        private DataTable GetZXSQ()
        {
            DataTable testSource = new DataTable();
            testSource.Columns.Add("Url", typeof(System.String));
            testSource.Columns.Add("Title", typeof(System.String));
            testSource.Columns.Add("XJLX", typeof(System.String));
            testSource.Columns.Add("Day", typeof(System.DateTime));
            DataRow dr = null;
            for (int i = 1; i < 5; i++)
            {
                dr = testSource.NewRow();
                dr["Url"] = "#";
                if (i % 2 == 0)
                {
                    dr["XJLX"] = "投诉";
                    dr["Title"] = "九亭镇涞寅路已污染的小河";
                }
                else
                {
                    dr["XJLX"] = "意见建议";
                    dr["Title"] = "镇属企业人员利用职权串通下家打...";
                }

                if (i == 4)
                    dr["XJLX"] = "咨询";

                dr["day"] = DateTime.Now;

                testSource.Rows.Add(dr);
            }
            return testSource;

        }

        protected void btnSearch_SQ_Click(object sender, EventArgs e)
        {

        }

        protected void btnSearch_selfSQ_Click(object sender, EventArgs e)
        {

        }
    }
}
